<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>$!surveyName</title>
<link rel="stylesheet" href="/include/manage/formbuilder/font-awesome.min.css" />
<link rel="stylesheet" href="/include/manage/formbuilder/formbuilder-min.css" />
  <style>
  * {
    box-sizing: border-box;
  }

  #fb-main {
    background-color: #fff;
    border-radius: 5px;
    min-height: 600px;
  }

  input[type=text] {
    height: 26px;
    margin-bottom: 3px;
  }

  select {
    margin-bottom: 5px;
  }
  </style>
<script language="javascript" src="/include/manage/js/jquery.js"></script>
<script language="javascript" src="/include/manage/js/jquery-ui.js"></script>
</head>
<body>
<form action="/survey.do" method="post" enctype="multipart/form-data">
	<input type="hidden" name="parameter" value="save" />
	<input type="hidden" name="sid" value="$!sid" />
	<div class="fb-response-fields">
		#set($i=1)
		#foreach($field in $fields)
		<div class="fb-field-wrapper response-field-$!field.getString("field_type")">
			<div class="subtemplate-wrapper">
				#set($fieldOpt=$field.getJSONObject("field_options"))
				#if($field.getString("field_type").equals("section_break"))
					<label class="section-name">
						$!field.getString("label")
					</label>
					<p>#if($fieldOpt.get("description"))$!fieldOpt.getString("description")#end</p>
				#else
					<label><span>$!field.getString("label")
						#if($field.getBoolean("required"))
						<abbr title="required">*</abbr>
						#end
					</span></label>
					#if($field.getString("field_type").equals("paragraph"))
						<textarea name="f$i" class="rf-size-$!fieldOpt.getString("size")"></textarea>
					#elseif($field.getString("field_type").equals("checkboxes") or $field.getString("field_type").equals("radio"))
						#set($inputType="radio")
						#if($field.getString("field_type").equals("checkboxes"))
							#set($inputType="checkbox")
						#end
						#set($checkOpts=$fieldOpt.getJSONArray("options"))
						#foreach($checkOpt in $checkOpts)
						  <div>
						    <label class="fb-option">
						      <input name="f$i" type="$inputType" value="$checkOpt.getString("label")" checked="$checkOpt.getBoolean("checked")" />
						      $checkOpt.getString("label")
						    </label>
						  </div>
	  					#end
						#if($fieldOpt.getBoolean("include_other_option"))
						  <div class="other-option">
						    <label class="fb-option"><input name="f$i" type="$inputType" />其它</label>
						    <input name="f$i" type="text" />
						  </div>
						#end
					#elseif($field.getString("field_type").equals("date"))
						<div class="input-line">
						  <span class="year">
						    <input name="f$i" type="text"/>
						    <label>年YYYY</label>
						  </span>
						  <span class="above-line">/</span>
						  <span class="month">
						    <input name="f$i" type="text"/>
						    <label>月MM</label>
						  </span>
						  <span class="above-line">/</span>
						  <span class="day">
						    <input name="f$i" type="text"/>
						    <label>日DD</label>
						  </span>
						</div>
					#elseif($field.getString("field_type").equals("dropdown"))
						<select name="f$i">
						#set($fieldOpt=$field.getJSONObject("field_options"))
						#set($checkOpts=$fieldOpt.getJSONArray("options"))
						#if($fieldOpt.getBoolean("include_blank_option"))
							<option></option>
						#end
						#foreach($checkOpt in $checkOpts)
							<option value="$checkOpt.getString("label")" #if($checkOpt.getBoolean("checked"))checked#end>$checkOpt.getString("label")</option>
						#end
						</select>
					#elseif($field.getString("field_type").equals("time"))
						<div class="input-line">
						  <span class="hours">
						    <input name="f$i" type="text"/>
						    <label>时HH</label>
						  </span>
						  <span class="above-line">:</span>
						  <span class="minutes">
						    <input name="f$i" type="text"/>
						    <label>分MM</label>
						  </span>
						  <span class="above-line">:</span>
						  <span class="seconds">
						    <input name="f$i" type="text"/>
						    <label>秒SS</label>
						  </span>
						  <span class="am_pm">
						    <select>
						      <option>上午AM</option>
						      <option>下午PM</option>
						    </select>
						  </span>
						</div>
					#elseif($field.getString("field_type").equals("price"))
						<div class="input-line">
						  <span class="above-line">￥</span>
						  <span class="dolars">
						    <input name="f$i" type="text"/>
						    <label>元</label>
						  </span>
						  <span class="above-line">.</span>
						  <span class="cents">
						    <input name="f$i" type="text"/>
						    <label>角</label>
						  </span>
						</div>
					#elseif($field.getString("field_type").equals("address"))
						<div class="input-line">	
						  <span class="street">
						    <input name="f$i" type="text"/>
						    <label>地址</label>
						  </span>
						</div>
						<div class="input-line">
						  <span class="city">
						    <input name="f$i" type="text"/>
						    <label>城市</label>
						  </span>
						  <span class="state">
						    <input name="f$i" type="text"/>
						    <label>省 / 地区</label>
						  </span>
						</div>
						<div class="input-line">
						  <span class="zip">
						    <input name="f$i" type="text"/>
						    <label>邮编</label>
						  </span>
						  <span class="country"/>
						    <select name="f$i"><option>中国</option></select>
						    <label>国家</label>
						  </span>
						</div>
					#elseif($field.getString("field_type").equals("file"))
						<input name="f$i" type="file"/>
					#else
						<input name="f$i" class="rf-size-$!fieldOpt.getString("size")" type="text"
						#if($field.getString("field_type").equals("website"))placeholder="http://"#end
						 />
					#end
					<span class="help-block">#if($fieldOpt.get("description"))$!fieldOpt.getString("description")#end</span>
					#set($i=$i+1)
				#end
			</div>
		</div>
		#end
	</div>
	<div>
		<input type="submit" name="submit" value="提交" />
		<input type="reset" name="reset" value="重置" />
	</div>
</form>
</body>
</html>